package com.atlas.micro.trafico;

import javax.microedition.lcdui.*;


/**
 * <p>Title: TraficoMadrid</p>
 *
 * <p>Description: Programa j2me para ver las cámaras de Tráfico de Madrid</p>
 *
 * <p>Copyright: Copyright (c) Antonio García Rodríguez 2005</p>
 *
 * <p>Company: </p>
 *
 * @author Antonio García Rodríguez
 * @version 1.0
 */
public class TraficoMovilPrincipalDisp extends List implements Constants {
    
   private Font font = null;
    
    private String[] arrayCamaras = null;
    
    public TraficoMovilPrincipalDisp() {
        super("Tráfico Móvil", List.IMPLICIT, ARRAY_VACIO ,null);  
        font = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_SMALL);
        setTicker(new Ticker("0 kb leidos"));        
    }
    
    public void setCamaras(String camaras[]){       
       deleteAll();
       if(camaras==null || camaras.length == 0){
        camaras = ARRAY_VACIO;
       }
       for (int i = 0; i < camaras.length; i++) {
           append(camaras[i], null);
       }    
       for (int i = 0; i < camaras.length; i++) {
           this.setFont(i, font);
       }    
       
       this.setSelectedIndex(0, true);
        
    }
}
